package com.henry.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Value("${server.port}")
    private int port;

    @Value("${server.port1:9999}")
    private int port1;


    @RequestMapping("/port")
    public String port(){
        return "server.port is " + port;
    }

    @RequestMapping("/port1")
    public String port1(){
        return "server.port1 is " + port1;
    }

    @RequestMapping("/")
    public String index(){
        return "Welcome to Spring Boot!";
    }

    @RequestMapping("/hello/user")
    public String hello(){
        return "henry, welcome to study springboot";
    }
}
